package com.slz3.business.module.socialManagement.socArticle.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.socialManagement.socArticle.domain.SocArticle;
import com.slz3.business.module.socialManagement.socArticle.domain.SocArticleCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class SocArticleResAtomic {

    public Mono<ServerResponse> add_$SocArticleUpdateLock(ServerRequest req, SocArticle socArticle) {
        return SocArticleResSafeValid.add(req, socArticle) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.add(req, socArticle);
    }

    public Mono<ServerResponse> delete_$SocArticleUpdateLock(ServerRequest req, SocArticleCondition socArticleCondition) {
        return SocArticleResSafeValid.delete(req, socArticleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$SocArticleUpdateLock(ServerRequest req, SocArticle socArticle) {
        return SocArticleResSafeValid.modify(req, socArticle) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.modify(req, socArticle);
    }

    public Mono<ServerResponse> info_$SocArticleUpdateLock(ServerRequest req) {
        return SocArticleResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$SocArticleUpdateLock(ServerRequest req, SocArticleCondition socArticleCondition) {
        return SocArticleResSafeValid.auditSubmit(req, socArticleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$SocArticleUpdateLock(ServerRequest req, SocArticleCondition socArticleCondition) {
        return SocArticleResSafeValid.audit(req, socArticleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$SocArticleUpdateLock(ServerRequest req, SocArticleCondition socArticleCondition) {
        return SocArticleResSafeValid.auditReject(req, socArticleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$SocArticleUpdateLock(ServerRequest req, SocArticleCondition socArticleCondition) {
        return SocArticleResSafeValid.usingEnable(req, socArticleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$SocArticleUpdateLock(ServerRequest req, SocArticleCondition socArticleCondition) {
        return SocArticleResSafeValid.usingDisable(req, socArticleCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocArticleResExecutor.usingDisable(req);
    }
}
